<template>
	<view :class="APP_FONT_SIZE">
		<custom title="账号" mode="2" fixed="fixed"> </custom>

		<view class="flex">
			<view class="flex-content">
				<cell-list class="mt-20">
					<cell title="手机号" type="none">
						<view slot="right" class="color-999999 fs-28">{{user_info.phone}}</view>
					</cell>
				</cell-list>
				<cell-list class="mt-20">
					<cell title="密码" @click="toPage('/pages/user/password')">
						<view slot="right" class="color-999999 fs-28"></view>
					</cell>
				</cell-list>
				<cell-list class="mt-20">
					<cell title="注销账号" @click="logout">
						<view slot="right" class="color-999999 fs-28"></view>
					</cell>
				</cell-list>
			</view>
		</view>



		<toast ref="toast">
			<view slot="center" class="color-333333 fs-24"
				style="line-height: 46rpx;padding: 0 20rpx 0 30rpx;white-space: pre-line;text-align: left;">
				<view class="bold" style="margin-bottom: 10rpx;">注销前请认真阅读以下重要提醒。账号注销后，您将无法再使用该账号，包括但不限于:</view>
				1.注销账号为不可恢复操作，账号一旦注销成功，您将无法登录、使用该账号，也无法找回或者处置该账号中及账号相关的任何内容、信息或资产，无法重新注册账号:
				2.您对账号的注销行为将视为您自愿、主动放弃包括个人信息、发布内容、会员等信息和资产虚拟权益，因此请您在申请注销前自行备份并妥善处理相关信息和事宜;
				3.注销期间，如果经核查发现您的账号存在未结的争议纠纷，包括但不限于被投诉、举报或违反法律法规等，我们有权拒绝您的账号注销申请而无需另行得到您的同意;
				4.注销完成后，发个信将依法删除您的个人信息，法律法规另有规定的除外。
			</view>
		</toast>
	</view>
</template>

<script>
	let envinfo = require("../../siteinfo.js");
	export default {
		data() {
			return {
				envinfo: envinfo,
			};
		},
		methods: {
			logout() {
				this.$refs.toast.open({
					desc: ``,
					left: "取消",
					right: "注销",
					success: () => {
						this.toPage('/pages/setting/logoff');
						return;
						this.less(() => {
							this.request({
								url: "/user/writeOff",
							}).then((res) => {
								// uni.$emit('logout');
								this.showToast('注销成功，等待后台审核');
								this.vuexSet("user_info", {}, true);
								uni.setStorageSync("ACCESS_TOKEN", "");
								uni.redirectTo({
									url: "/pages/login/login",
								});

								if (getApp().globalData.CHAT && getApp().globalData.CHAT
									.CLOSE) {
									getApp().globalData.CHAT.CLOSE();
								}
							});
						});
					},
				});
				uni.setStorage({
					key: "openid",
					data: "",
				});
			},
			choose_image() {
				uni.chooseImage({
					count: 1,
					success: (res) => {
						let {
							tempFilePaths = []
						} = res;
						console.log("res", res);
						tempFilePaths.forEach((val) => {
							// #ifdef APP-PLUS
							uni.compressImage({
								src: val,
								width: "200",
								success: (img) => {
									this.upload_image(img.tempFilePath);
									console.log("img.tempFilePath", img.tempFilePath);
								},
								fail: (err) => {
									console.log("err", err);
								},
							});
							// #endif

							// #ifdef H5
							this.upload_image(val);
							// #endif
						});
					},
				});
			},

		},
	};
</script>

<style>
	page {
		background-color: #f0f2f5;
		font-size: 26rpx;
	}

	.item-list-box {
		border-bottom: 2rpx solid #eeeeee;
		color: #323232;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		background-color: #fff;
		padding: 30rpx 30rpx 30rpx 40rpx;
		line-height: 30rpx;
	}

	.setting-item {
		height: 112rpx;
		background-color: #ffffff;
		padding-right: 30rpx;
		color: #333 !important;
	}

	.setting-item>view {
		/* color: rgba(255, 255, 255, 1); */
	}

	.setting-item+.setting-item {
		/* border-top: 0.5px solid #D8D8D8; */
		border-top: 0.5px solid #eeeeee;
	}

	.abcd {
		height: 108rpx;
		background: #ffffff;

		color: #333;
	}

	.gray {
		color: #d4d5d7;
	}
</style>